<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        * {
            padding: 0;
            margin: 0 auto;
        }
        a {
            text-decoration: none;
            color: #666666;
        }
        .footer {
            margin: 0 auto;
            height: 415px;
            background-color: #f5f5f5;
            padding-top: 30px;
        }
        .mod_help {
            height: 185px;
            border-bottom: 1px solid #ccc;
            padding-top: 20px;
            padding-left: 120px;
        }
        .mod_help dl {
            float: left;
            width: 200px;
        }
        .mod_help dl:last-child {
            width: 90px;
            text-align: center;
        }
        .mod_help dl dt {
            font-size: 16px;
            margin-bottom: 10px;
        }
        .mod_copyright {
            text-align: center;
            padding-top: 20px;
        }

        body{
            margin: 0;/*去掉外边距*/
            background-size: cover;/*设置封面*/
            text-align: center;/*页面内部的文本居中*/
        }

        img{
            width: 100px;
        }
        h2{
            font-size: 32px;
            color: #0096dc;
            margin-bottom: 0;
        }
        #app {
            width: 1200px;
            height: 700px;
        }
        #app1 {
            height: 50px;
        }
    </style>
</head>
<body>
<!--头部-->
<div style="width: 1200px;margin: 0 auto;background-color: #fff">
    <a href="/"><img src="../imgs/logo.png" style="width: 50px;margin-left: 50px;vertical-align: middle" alt="" ></a>
    <a href="index.html" style="margin-left: 130px">首页</a><el-divider direction="vertical"></el-divider>
    <a href="fashourili.html" style="margin-left: 50px">发售日历</a><el-divider direction="vertical"></el-divider>
    <a href="aboutus.html" style="margin-left: 50px">关于我们</a><el-divider direction="vertical"></el-divider>
    <a href="helloeui.html" style="margin-left: 50px">公告</a><el-divider direction="vertical"></el-divider>
    <a href="personal.html" style="margin-left: 50px">个人中心</a><el-divider direction="vertical"></el-divider>
    <span style="margin-left: 200px;"><a href="login.html">登录</a>
  |
    <a href="reg.html">注册</a></span>
</div>
<hr>
<div id="app">
    <div id="app1"></div>

    <el-card style="width: 600px;height: 600px;margin: 0 auto;
                background-color: rgba(255,255,255,0.3)">
        <h1>注册</h1>
        <!--label-width设置用户名这一列所占的宽度,如果不设置会显示在上面-->
        <el-form label-width="100px" style="width: 400px;margin: 40px auto">
            <el-form-item label="真实姓名">
                <el-input type="text" v-model="user.username" placeholder="请输入用户名"></el-input>
            </el-form-item>
            <el-form-item label="昵称">
                <el-input type="text" v-model="user.nickname" placeholder="请输入昵称"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input type="password" v-model="user.password" placeholder="请输入密码"></el-input>
            </el-form-item>
            <el-form-item label="确认密码">
                <el-input type="password" v-model="user.password" placeholder="请再次输入密码"></el-input>
            </el-form-item>
            <el-form-item label="手机号">
                <el-input type="text" v-model="user.phoneNumber" placeholder="请输入手机号"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button style="position: relative;right: 30px"
                           type="primary" @click="login()">注册</el-button>
            </el-form-item>
        </el-form>
    </el-card>
</div>
<hr>


<!--尾部-->
<footer class="footer" style="width: 1200px;margin: 0 auto;background-color: #fff">
    <div class="w">
        <div class="mod_copyright">
            <div class="mod_help">
                <img src="../imgs/logo.png" style="float: left;width: 100px;">
                <dl>
                    <dt>联系我们</dt>
                    <dd><a href="/">微信</a></dd>
                </dl>
                <dl>
                    <dt>关于我们</dt>
                    <dd><a href="/">关于星元</a></dd>
                    <dd><a href="#">星元公众号</a></dd>
                </dl>
                <dl>
                    <dt>用户协议</dt>
                    <dd><a href="#">用户使用条款</a></dd>
                    <dd><a href="#">隐私政策</a></dd>
                    <dd><a href="#">消费者权益保障</a></dd>
                </dl>
                <dl>
                    <dt>帮助中心</dt>
                    <dd>
                    <dd><a href="/">常见问题</a></dd>
                    <img src="../imgs/logo.png" style="width: 80px;">
                    我的客服
                    </dd>
                </dl>
            </div>
            <div class="copyright">
                地址：北京市昌平区建材城西路金燕龙动公楼一层邮编：100096电话：
                400-618-4000传真：g1g-82935100邮箱：zhanghj+itcast.cn<br>
                京ICP备08001421号京公网安备110108007702
            </div>
        </div>
    </div>
</footer>

</body>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function() {
            return {
                user:{
                    phoneNumber:"",
                    username:"",
                    password:"",
                    nickname:"",
                    verificationCode:""
                }
            }
        },
        methods:{
            login(){
                axios.post("/login",v.user).then(function (response) {
                    if (response.data==1){
                        location.href="/admin.html";
                    }else if (response.data==2){
                        v.$message.error("用户名不存在");
                    }else {
                        v.$message.error("密码错误")
                    }
                })
            }
        }
    })
</script>
</html>